babyishfandomcom-20200214-history
Help:Magic words
This is an organized index of Magic words used in MediaWiki. A "magic word" is a symbol recognized by the MediaWiki software and which when seen in the non-commented text of the page, triggers the software to do something other than display that symbol, or transclude a page with that name, but instead to use the symbol directly. A magic word can be *an upper case word, preceded and followed by two underscores, e.g. *an XML object, coded similar to HTML, preceded by "<" (and for the end tag "/") and followed by ">", as in '...' *a parser function: similar to a template, a word preceded by the symbols " ", and optionally parameter definitions between pipe characters, except that the part before the first pipe (or without pipes, the text between the braces) contains a colon (":'"), e.g. and }>3|large|small}} *a variable: similar to a template without parameters, a word preceded by the symbols " ", except the word used is in all upper case, e.g. ''' *a template modifier *an image modifier If a page in the template namespace has the same name as a magic word, the magic word will be invoked instead. If you discover you absolutely have to define a template with the same name as a magic word, prefix the name of the template with "msg:" or the name of the template namespace ("Template:"). See below for further details if you need this feature. Tags which are used on this page such as "MW1.5+" indicate the version that first supported the magic word. "XYZ" indicates user input, which is used in the example. Magic words between double underscores Table of contents :For details see '' Other XML-style tags XML-style tags use the syntax <''tag name>''contents''. XML-style tags are frequently used by MediaWiki extensions; see Extending wiki markup for details on adding new tags. Default The following tags are available in a default MediaWiki installation. * parsing is the conversion of text markup and XHTML to formatting and structure like templates, links, formatting, line breaks, et cetera. Two tags affect parsing: ** nowiki disables parsing of all wiki syntax. For example, " " gives " ". ** pre mimics nowiki above in a formatted box, and preserves new lines. For example, " " outputs as: * transclusion is adding the content of one page to another using the template syntax. Three tags affect transclusion: ** noinclude prevents text from appearing when the page is transcluded, so the text will only be visible on the current page. For example, "Category:Foo" will only categorize the template page. ** includeonly hides text on the current page, so that it will only appear when the page is transcluded. For example, "Category:Foo" will categorize all pages that tranclude the template, but not the template itself. ** onlyinclude hides all other text when the page is transcluded, so that only the text inside the onlyinclude tags will be shown. For example, "I am an apple." will output "apple" when transcluded. * math uses TeX markup to generate complex mathematics, usually in image form (see ). For example, " \sqrt{a^2+b^2}" outputs as \sqrt{a^2+b^2} . Common extensions * hiero (WikiHiero extension) uses the Hieroglyph coding manual syntax to generate images of hieroglyphs. For example, "A1" outputs as A1. * categorytree (CategoryTree extension) uses custom syntax to create a dynamic view of the category structure. See the extension page for examples. Variables :For details see '' Time The time in UTC. Note that if the page was displayed by the same user and has not changed (has not been edited) since the last time it was displayed, it is possible that the page may be cached (by the user's browser) and the displayed time or date may not change. Also, if a heavily used page, rather than freshly rendered by the software each time it is generated, is instead being retrieved from a caching system (such as the main page on Wikipedia) the date or time may not change from the last time the page was originally retrieved by the caching hardware or software. Local time The time depending on the local timezone of the wiki (''not depending on the timezone in the user's preference settings). (All words MW1.8+ ) *See also the ParserFunction #time: Statistics Statistics variables give thousands separators unless ":R" for "raw" is added (actually, these versions are parser functions). Page names and related info Parser functions :For details see . Not working at the position of the page where the tag is located but on the page header, and throughout the page, respectively (see below): *DISPLAYTITLE: allow the page header to be different from the page name. *DEFAULTSORT: Sets a default for the page. Namespaces and URLs Formatting With regard to #language and , see also: *List of Wikipedias/local names - shows both names for all languages, without automatic comparison *List of Wikipedias/local names/diff - values of for which contains a different name. *List of Wikipedias/local names/diff 1 - for languages where the two names are different, shows both; due to the the end of the table is messed up Template modifiers Image modifiers :For details see w:en:Wikipedia:Extended image syntax. These are modifiers used in links. Some are mutually exclusive, and then the last specified wins. The last unrecognized modifier is used as caption for framed images or together with thumbnail''s. It's also used as description alt=''text. Size Position :For details see '' The positions are mutually exclusive; the last specified wins. Template:- can stop floating. For inline images only modifier ''px (see above) is supported. Miscellany Language-dependent word conversions "Grammar" and "Plural" are language-dependent functions, defined in http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageCs.php, http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageRu.php, etc. (note that in PHP, the modulo operator is the percent sign). "Grammar" can either be applied to predefined words only, or to arbitrary words, depending on whether the definition is just a 2D array, or involves string manipulations. See also cs:Šablona:Wikivar/GRAMMAR. "Plural" is a site-language-dependent switch function, controlled by function convertPlural in Language.php (which distinguishes between 1 and "not 1"), for some languages overridden in Languagexx.php, e.g. for French (which distinguishes between <=1 and >1) and Russian (oddly, first option is 1, 21, 31,.., 91, 101, 121, .., second is 2, 3, 4, 22, 23, 24, 31, 32, 33, 41,.., 94, 102, 103, 104,.., 122, 123,.., and else the third). As opposed to ParserFunctions, "plural" accepts points and commas in numbers and interprets them in a site-language-specific way (depending on $separatorTransformTable in Messagesxx.php); on this site: * gives * gives (on e.g. the German and the Dutch sites reversed w.r.t. the result on English sites). "Plural" is used in various system messages, e.g. , where it uses interface language instead of site language. See also *ParserFunctions #expr:, #if:, #ifeq:, etc. *mw:Manual:Magic words *Source for Language.php *Source for MagicWord.php *Adding parser functions *mw:Extension:Variables : adding new magic words like Notes and references